/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.prashant.sqlduniya.editor.action;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import org.openide.awt.ActionID;
import org.openide.awt.ActionReference;
import org.openide.awt.ActionReferences;
import org.openide.awt.ActionRegistration;
import org.openide.util.NbBundle.Messages;
import org.openide.windows.TopComponent;
import org.prashant.sqlduniya.editor.QueryEditorTopComponent;

@ActionID(category = "File",
id = "org.prashant.sqlduniya.editor.action.NewQueryEditorAction")
@ActionRegistration(displayName = "#CTL_NewQueryEditorAction")
@ActionReferences({
    @ActionReference(path = "Menu/File", position = 1300),
    @ActionReference(path = "Shortcuts", name = "D-N")
})
@Messages("CTL_NewQueryEditorAction=New Query Tab")
public final class NewQueryEditorAction implements ActionListener {

    public void actionPerformed(ActionEvent e) {
        TopComponent tc = new QueryEditorTopComponent();
//        Mode m = WindowManager.getDefault().findMode("explorer");
//        if(m != null)
//        m.dockInto(tc);
        tc.open();
        tc.requestActive();
    }
}
